<template>
  <div class="did-h">
    <!-- 表格 -->
    <el-table :data="tableData" ref="multipleTable" tooltip-effect="dark" style="width: 100%" :default-sort="{ prop: 'date', order: 'descending' }">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="tacticalChainDid" label="战术链DID" width="450" align="center"></el-table-column>
      <el-table-column prop="tacticalName" label="战术链名称" width="300" align="center"></el-table-column>
      <el-table-column prop="creationTime" label="时间" width="220" align="center"></el-table-column>
      <el-table-column prop="state" label="状态" show-overflow-tooltip width="120" align="center"> </el-table-column>
      <el-table-column prop="state" label="战术链详情" show-overflow-tooltip width="250px" align="center">
        <template slot-scope="scope">
          <el-button type="primary" icon="el-icon-copy-document" size="small" @click="goTotacticalChainInfo(scope.row)" align="center">战术链详情</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="state" label="链上人员信息" show-overflow-tooltip width="250px " align="center">
        <template slot-scope="scope">
          <el-button type="primary" icon="el-icon-user-solid" size="small" @click="goTochainMemberList(scope.row)" align="center">链上人员信息</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <!-- <el-pagination background layout="prev, pager, next" :total="100" style="margin-top: 30px"></el-pagination> -->
  </div>
</template>
  <script>
import NoData from '../../components/noData.vue';
export default {
  created() {
    this.getTacticalchainListByUserDid();
  },
  components: {
    NoData,
  },
  data() {
    return {
      activeName: 'first',
      form: {
        did: '',
        textarea: '',
      },
      data: '',
      input3: '',
      tableData: [],
    };
  },
  mounted() {},
  methods: {
    goTotacticalChainInfo(row) {
      this.$router.push({
        // 推送方法
        path: '/tacticalList', //导航的路径
        query: { tacticalChainDid: row.tacticalChainDid },
      });
    },
    goTochainMemberList(row) {
      console.info(row.tacticalChainDid);
      this.$router.push({
        // 推送方法
        path: '/chainMemberList', //导航的路径
        query: { tacticalChainDid: row.tacticalChainDid },
      });
    },
    async getTacticalchainListByUserDid() {
      const userDid = window.localStorage.getItem('userDid');
      let formData = new FormData();
      formData.append('userDid', userDid);
      let res = await this.$http.post(this.$api.tacticalChain.tacticalchainListByUserDid, formData);
      if (res.code == 0) {
        this.tableData = res.data;
        console.log("dsad");
        console.log(this.tableData);
      }
    },
  },
};
</script>
  <style lang="less" scoped>
.did-content {
  margin-top: 10%;
  h1 {
    color: #666666;
    width: 320px;
    margin: 0 auto;
  }
}
.did-button {
  width: 100px;
  margin: 0 auto;
  margin-top: 20px;
}
.m-a0 {
  margin: 0 auto;
}
.black-h {
  height: 50%;
}
.black-height {
  height: calc(50% - 90px);
}
.nodata {
  margin-top: 10%;
}
.did-width {
  width: 500px;
  margin: 0 auto;
}
.text-c {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}
</style>
  